package clientApp.utils;

import java.util.ArrayList;
import java.util.List;

import javax.swing.table.AbstractTableModel;
import game.units.Monster;

public class MonsterNode extends AbstractTableModel {

	private static final long serialVersionUID = 1L;
	
	public List<Monster> monsters = new ArrayList<Monster>();
	
	@Override
	public int getColumnCount() {
		// Name, Race, Class, Level
		return 4;
	}

	@Override
	public int getRowCount() {
		return monsters.size();
	}

	@Override
	public Object getValueAt(int row, int col) {
		Monster monster = monsters.get(row);
		switch(col)
		{
		case 0:
			return monster.getName();
		case 1:
			return monster.getRace();
		case 2:			
			return monster.getChallenge();
		case 3:			
			return monster.getExperience();
		default:
			return null;
		}
		
	}
	
	@Override
	public String getColumnName(int col) {
		switch(col)
		{
		case 0:
			return "Name";
		case 1:
			return "Race";
		case 2:			
			return "Challenge";
		case 3:			
			return "Expirience";
		default:
			return null;
		}
	}
	

	public List<Monster> getMonsters() {
		return monsters;
	}

	public void setMonsters(List<Monster> monsters) {
		this.monsters = monsters;
	}
	
	

}
